﻿// -------------------------------------------------------------------------------------------------------------------------------
// <copyright file="IterationsStopCriterion{T}.cs" company="Exul">
//     Copyright (c) Exul. All rights reserved.
// </copyright>
// <author>
//     Exul
// </author>
// -------------------------------------------------------------------------------------------------------------------------------

namespace ExulLibrary.Mathematics.LinearAlgebra
{
    #region Usings

    using System;

    #endregion

    /// <summary>
    ///     Provides methods to determine the end of an iteration process.
    /// </summary>
    /// <typeparam name="T">
    ///     The type of data.
    /// </typeparam>
    public abstract class IterationsStopCriterion<T>
    {
        #region Methods

        #region public

        /// <summary>
        ///     Determines whether an iteration process should be stopped.
        /// </summary>
        /// <param name="data">
        ///     The data describing a current state of the iteration process.
        /// </param>
        /// <returns>
        ///     <see langword="true"/> if the iteration process should be stopped; otherwise, <see langword="false"/>.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="data"/> is <see langword="null"/>.
        /// </exception>
        public abstract bool ShouldStop(IterationData<T> data);

        #endregion

        #endregion
    }
}